checkout: Fix fsync defaults for new API to be off for real
authorColin Walters <walters@verbum.org>
Tue, 4 Oct 2016 19:39:15 +0000 (15:39 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 5 Oct 2016 21:34:57 +0000 (21:34 +0000)
My previous change in https://github.com/ostreedev/ostree/pull/425
actually broke things so we basically used the repository defaults =(

This is a subtle mess since we're only trying to flip things off
for the *new* API.

Clean this up so that the "default repo inheritance" lives only in one
place - in the compat layer for the old checkout API.  The new
checkout API defaults to off period, so the repository state is
irrelevant.

Closes: #520
Approved by: jlebon

src/libostree/ostree-repo-checkout.c

index bf18c9e4eb6761d9b1fde203eb8a8a95b1c16099..23258a47c492e15d6a3710124d41dd5c764cef1e 100644 (file)
@@ -106,7 +106,7 @@ static gboolean
 fsync_is_enabled (OstreeRepo   *self,
                   OstreeRepoCheckoutAtOptions *options)
 {
-  return options->enable_fsync || !self->disable_fsync;
+  return options->enable_fsync;
 }
 
 static gboolean
@@ -860,7 +860,7 @@ ostree_repo_checkout_tree_at (OstreeRepo                        *self,
   new_opts.mode = options->mode;
   new_opts.overwrite_mode = options->overwrite_mode;
   new_opts.enable_uncompressed_cache = options->enable_uncompressed_cache;
-  new_opts.enable_fsync = !options->disable_fsync;
+  new_opts.enable_fsync = options->disable_fsync ? FALSE : self->disable_fsync;
   new_opts.process_whiteouts = options->process_whiteouts;
   new_opts.no_copy_fallback = options->no_copy_fallback;
   new_opts.subpath = options->subpath;